﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>知识内容</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <script src="components/requirejs/require.js" async="async" data-main="resources/js/knowledgeDetail"></script>
    <link href="components/mint-ui/style.min.css" rel="stylesheet" />
    <link href="resources/css/common.css" rel="stylesheet" />
    <link href="resources/css/knowledgeDetail.css" rel="stylesheet" />
</head>
<body>
    <div id="view">
        <div view v-if="isloading"></div>

        <div detail>
            <div center>{{detail.title}}</div>
            <div center>{{detail.publish_date}}</div>
            <div center>
                <img src="resources/image/knowledgeDetail/read.png" />
                <div>{{detail.read_times}}</div>
                <div rate v-if="!isHelp">
                    共{{comments.length}}评价 平均评分{{avgRate}}
                </div>
            </div>
            <div v-html="detail.contents"></div>
        </div>

        <div item v-for="item in comments">
            <div center-v>
                <div center start>
                    <span v-if="!isHelp">{{"★★★★★☆☆☆☆☆".slice(5 - item.comment_type, 10 - item.comment_type)}}</span>
                </div>
                <div>{{item.commenter_name}}</div>
                <div>
                    评论时间：{{item.comment_time}}
                </div>
            </div>
            <div>{{item.content}}</div>
        </div>

        <div placeholder-bottombar>
        </div>
        <div bottombar v-if="showComment && !isHelp">
            <div v-on:click="commentary(1)" center start>{{commentaryType > 0 ? "★" :"☆" }}</div>
            <div v-on:click="commentary(2)" center start>{{commentaryType > 1 ? "★" :"☆" }}</div>
            <div v-on:click="commentary(3)" center start>{{commentaryType > 2 ? "★" :"☆" }}</div>
            <div v-on:click="commentary(4)" center start>{{commentaryType > 3 ? "★" :"☆" }}</div>
            <div v-on:click="commentary(5)" center start>{{commentaryType > 4 ? "★" :"☆" }}</div>
        </div>

        <div bottombar v-if="isHelp">
            <textarea v-model="comment" placeholder="请输入您需要求助的内容"></textarea>
            <input type="button" value="确认" v-on:click="popupCommentary" />
        </div>

        <mt-popup commentary v-model="commentaryVisible" pop-transition="popup-fade">
            <div>
                <textarea v-model="comment" placeholder="请输入您的评分理由"></textarea>
            </div>
            <div submitBar center>
                <input type="button" value="确认" v-on:click="popupCommentary" />
            </div>
        </mt-popup>
    </div>
</body>
</html>